# 商业转载请联系作者获得授权，非商业转载请注明出处。
# For commercial use, please contact the author for authorization. For non-commercial use, please indicate the source.
# 协议(License)：署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
# 作者(Author)：
# 链接(URL)：http://www.ryuichi.tech/88.html#E_-_Colorful_Blocks
# 来源(Source)：

#include<bits/stdc++.h>
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define debug  freopen("in.txt","r",stdin),freopen("out.txt","w",stdout);
#define fs first
#define sc second
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 1e6+10;
const int inf = 1e9;
using namespace std;
 
int N,M,X;
int a[15][15];
int judge(int ch){
    int money = 0;
    vector<int> ve(M+1,0);
    for(int i = 0;i<N;i++){
        if((ch>>i) & 1){
            money += a[i+1][0];
            for(int j = 1;j<=M;j++){
                ve[j] += a[i+1][j];
            }
        }
    }
    for(int j = 1;j<=M;j++){
        if(ve[j] < X) return inf;
    }
    return money;
}
 
int main(){
    // debug;
    ios;
    cin>>N>>M>>X;
    for(int i = 1;i<=N;i++) for(int j = 0;j<=M;j++) cin>>a[i][j];
    int ans = inf;
    for(int i = 0;i<(1<<N);i++){
        ans = min(ans,judge(i));
    }
    cout<<((ans == inf)?-1:ans)<<'\n';
 
    return 0;
}
